%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Will return the matrix A which         %
%contains the correspondent coordinates %
%of both images (x,xp)                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function A = get_A(x_h,xp_h)

[m ~] = size(x_h);
A = zeros(m,9);

for i=1:m
    x1=x_h(i,1);
    y1=x_h(i,2);
    x2=xp_h(i,1);
    y2=xp_h(i,2);
    A(i,:) =[x1*x2 y1*x2 x2 x1*y2 y1*y2 y2 x1 y1 1]; 
end